Root/
/* Irrlicht Library Wrapper Created by: Nathan Adams Denzel Morris Copyright (C) 2007 This software is licensed under the GNU/GPL. This software may not be used for commerical purposes. */ #ifndef IRRLIB_H #define IRRLIB_H /* We should include some basic functions */ #include <iostream> /* include strings */ #include <strings.h> #include <irrlicht.h> #include <time.h> /* We have to include Irrlichts libs */ #include "Irr3D.h" #include "IrrColor.h" #include "IrrLibGUI.h" #include "IrrEventReciever.h" #include "Irr2D.h" #include "IrrLibBase.h" #include "IrrData.h" typedef irr::core::dimension2d<irr::s32> PixelSize; /*struct IrrObj { int eventid; int objectid; };*/ //Start class class IrrLib: public IrrLibBase { private : /* Create an Irrlicht device as private because the class should handle All irrlicht interaction */ irr::IrrlichtDevice *device; // Tells Irrlicht what driver to use //video::E_DRIVER_TYPE driverType; /* Get a pointer to the video driver and the SceneManager so that we do not always have to write device->getVideoDriver() and device->getSceneManager(). */ irr::video::IVideoDriver* driver; irr::scene::ISceneManager* smgr; irr::gui::IGUIEnvironment* env; /* Get a pointer to the 'mesh' aka the level. Note: This is for Quake3 levels, ie bsp maps. */ irr::scene::IAnimatedMesh* mesh; irr::scene::ISceneNode* node; irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it irr::scene::ICameraSceneNode * cam; char key; void IrrLib::Init(); /*friend class IrrColor; friend class Irr2DLib; friend class Sphere;*/ friend class IrrEventReciever; irr::u32 tick; irr::ITimer* timer; public : //IrrSphere Sphere; //This has to be public to be able to access the Sphere class /* IrrSphere is now in Irr3D class */ //Prehaps put this into a IrrLib3D class? Irr3D Irr3DLib; IrrColor Color; //Color class...not much of a class but lets keep it OO Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number IrrLibGUI GUI; IrrEventReciever IrrEvent; IrrLib::IrrLib(); //IrrLib::IrrLib(MastEventReceiver & receiver); IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync); IrrLib::IrrLib( int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync); IrrLib::~IrrLib(); //Our moms wont clean up after us! void IrrLib::ReadArchive(std::string file); void IrrLib::LoadQ3Level(std::string q3level); void IrrLib::MapPos( int x, int y, int z); //I think this moves the actual camera? void IrrLib::MapPos(); void IrrLib::AddFPSCam(); void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z); void IrrLib::VisibleCursor( bool tf); int IrrLib::GetFPSCount(); bool IrrLib::DeviceIsRunning(); bool IrrLib::IsActiveWindow(); void IrrLib::BeginScene(); void IrrLib::BeginScene(irr::video::SColor color); //void IrrLib::BeginScene(irr::video::SColor * color); void IrrLib::BeginScene( bool usebackBuffer, bool usezBuffer, irr::video::SColor color); //TODO: Add one more for human readable colors and hex colors! void IrrLib::DrawAll(); void IrrLib::EndScene(); void IrrLib::SetWindowCaption(irr::core::stringw str); irr::core::stringw IrrLib::GetDriverName(); //TODO: Make function to turn stringw to string and visa versa void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht //TODO: Add logging void IrrLib::KeyPress( char key); char IrrLib::KeyPressed(); irr::f32 getX(); irr::f32 getY(); irr::f32 getZ(); bool CheckGameLoop(); bool CheckGameLoop(irr::u32 ms); void Exit(); PixelSize GetScreenSize(); //void EndGameLoop(); //template <class T> std::string to_string (T t); }; #endif |
Source at commit tip created 11 years 4 months ago. By Nathan Adams, Migrating from google code |
---|